package com.evenmo.pojo;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.Past;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

public class User3 implements Serializable{
@NotBlank(message="登录名不能为空")
	private String loginname;
@Length()
	private String password;
@NotBlank(message="用户名不能为空")
	private String username;
@Range(message="年龄在18到65位之间",min=18,max=65)
	private Integer age;
@Email(message="必须是合法的email地址")
	private String email;
@DateTimeFormat(pattern="yyyy-mm-dd")
@Past(message="必须是一个过去的日期")
	private Date birthday;
@Pattern(regexp="[1][3,8][3,6,9][0-9]{8}",message="无效的电话号码")
	private String phone;
	public String getLoginname() {
		return loginname;
	}
	public void setLoginname(String loginname) {
		this.loginname = loginname;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public Integer getAge() {
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public User3(String loginname, String password, String username, Integer age, String email, Date birthday,
			String phone) {
		super();
		this.loginname = loginname;
		this.password = password;
		this.username = username;
		this.age = age;
		this.email = email;
		this.birthday = birthday;
		this.phone = phone;
	}
	public User3() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Override
	public String toString() {
		return "User3 [loginname=" + loginname + ", password=" + password + ", username=" + username + ", age=" + age
				+ ", email=" + email + ", birthday=" + birthday + ", phone=" + phone + "]";
	}
	
}
